/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package visual.Almacenamiento;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author cesar
 */
public class Render extends DefaultTableCellRenderer {



    @Override
public Component getTableCellRendererComponent(JTable table, Object value,
                                     boolean isSelected, boolean hasFocus, int row, int column){

        setEnabled(table == null || table.isEnabled());
        if (String.valueOf(table.getValueAt(row, 0)).equals("XXXX") || String.valueOf(table.getValueAt(row, 5)).equals("Bloqueado") ||String.valueOf(table.getValueAt(row, 4)).equals("Bloqueado"))
            setBackground(Color.red);

        else
            if (String.valueOf(table.getValueAt(row, 5)).equals("Reservado"))
              setBackground(Color.yellow);
            else
              setBackground(null);
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

        return this;
}

}
